package com.yjs.houtai.service.serviceImpl;

import com.yjs.houtai.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.yjs.houtai.mapper.IndentMapper;
import com.yjs.houtai.entity.Indent;
import com.yjs.houtai.service.IndentService;
@Service
public class IndentServiceImpl implements IndentService{

    @Resource
    private IndentMapper indentMapper;

    @Override
    public Message deleteByPrimaryKey(Integer indentId) {
        return indentMapper.deleteByPrimaryKey(indentId)==1?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insert(Indent indent) {
        return null;
    }

    @Override
    public Message insertSelective(Indent indent) {
        return indentMapper.insertSelective(indent)==1?Message.success(null).add(indentMapper.selectByPrimaryKey(indent.getindentId())):Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer indentId) {
        return indentMapper.selectByPrimaryKey(indentId)!=null?Message.success(null).add(indentMapper.selectByPrimaryKey(indentId)):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKeySelective(Indent indent) {
        return indentMapper.updateByPrimaryKeySelective(indent)==1?Message.success(null).add(indentMapper.selectByPrimaryKey(indent.getindentId())):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(Indent indent) {
        return null;
    }

    @Override
    public Message selectAll() {
        return Message.success(null).add(indentMapper.selectAll());
    }

}
